package dongshi.daddy.visitor.objectstructure;

import dongshi.daddy.visitor.element.CorporateSlaveElement;
import dongshi.daddy.visitor.element.HumanSourceElement;
import dongshi.daddy.visitor.element.ProgrammerElement;
import dongshi.daddy.visitor.element.TesterElement;
import dongshi.daddy.visitor.visitor.CorporateSlaveVisitor;

import java.util.ArrayList;
import java.util.List;

public class BigHuYouCompany {
    private static List<CorporateSlaveElement> employee = new ArrayList() {
        {
            add(new ProgrammerElement("开发小草莓"));
            add(new HumanSourceElement("hr小酸梅"));
            add(new TesterElement("测试小葡萄"));
        }
    };
    private CorporateSlaveVisitor visitor;
//    public BigHuYouCompany() {
//        employee.add(new ProgrammerElement("开发小草莓"));
//        employee.add(new HumanSourceElement("hr小酸梅"));
//        employee.add(new TesterElement("测试小葡萄"));
//    }

    public BigHuYouCompany(CorporateSlaveVisitor visitor) {
        this.visitor = visitor;
    }

//    public void startProject(CorporateSlaveVisitor visitor){
    public void startProject(){
        for (CorporateSlaveElement slave : employee) {
            slave.accept(visitor);
        }
    }
}